
default_platform(:ios)

platform :ios do
  desc "自动上传私有库"
  lane :uploadPodLib do |options|
    msg = options[:msg]
    tag = options[:tag]

# pod install
    cocoapods(
    clean: true,
    podfile: "./Example/Podfile"
    )

# git add.
    git_add
# git commit -m 'xx'
    git_commit(path: ".", message: msg)
# git push
    push_to_git_remote(
    remote: "origin",
    local_branch: "master",
    tags: false     # optional, default: true
    )

# 验证tag是否存在,如果存在, 应该删除本地标签和远程标签
#if 判断标签是否存在
#    执行删除本地/远程标签
#end

if git_tag_exists(tag: tag)
UI.message("发现tag:#{tag} 已经存在, 即将执行, 删除动作 🚀")
delete_tag(tag:tag)
end

# git tag -a 0.6.0
    add_git_tag(
    tag: tag
    )
# git push --tags
    push_git_tags

# pod lib lint
    pod_lib_lint(allow_warnings: true, sources: ["https://gitee.com/Summer_c_xzx/Specs.git", "https://github.com/CocoaPods/Specs"])
# pod repo push Spec xx.podspec
pod_push(path: "OANetworkManager.podspec", repo: "OASpec", allow_warnings: true, sources: ["https://gitee.com/Summer_c_xzx/Specs.git", "https://github.com/CocoaPods/Specs"])
  end
end
